package com.example;

public class Main {
    public static void main(String[] args) {
        fun(Enum.OLD);
        fun(Enum.BOY);
    }

    /**
     *
     * @param a 接收的是一个枚举项
     */
    public static void fun(Enum a) {
        switch (a) {
            case BOY:
                System.out.println(1);
                break;
            case GIRL:
                System.out.println(2);
                break;
            case OLD:
                System.out.println(3);
                break;
            case YOUNG:
                System.out.println(4);
                break;
        }
    }
}
